#pragma GCC optimize(2)
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
#define pi acos(-1.0)
#define e exp(1.0)
typedef pair<ll,ll> pa;
const ll INF=0x3f3f3f3f3f3f3f3f;
ll T,bx,by,ex,ey;
int main()
{
//  freopen(".../.txt","w",stdout);
//  freopen(".../.txt","r",stdin);
	ios::sync_with_stdio(false);
	cin>>T;
	while(T--){
		cin>>bx>>by>>ex>>ey;
		ll res,N,M;
		N=ex-bx+1;
		M=ey-by+1;
		ll r=N+M-3;
		res=(N-1)*N/2*2+(N-1)*(r-2*(N-1))+1;
		cout<<res<<endl;
	} 
	return 0;
}
